package com.totem.base.constants;

import java.util.regex.Pattern;

/**
 * @author raymond
 * @version V1.0
 */
public class CommonConstants {
    public static final String APP_ID = "APP123456";

    public static final Integer APP_MAX_LOG_LENGTH = 100000;

    public static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
    public static final String DATETIMEMS_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";

    public static final String LOGIN_TYPE_KEY = "loginType";
    public static final String LOGIN_NICKNAME_KEY = "nickname";
    public static final String LOGIN_PASSWORD_KEY = "password";

    public static final String PARAMS_KEY = "params";
    public static final String PARAMS_TEMPLATE = "?"+PARAMS_KEY+"={"+PARAMS_KEY+"}";

    public static final boolean ENCRYPT_ENABLE = true;
    public static final String SYMMETRY_HEADER_CRYPTO = "CRYPTO";
    public static final String SYMMETRY_HEADER_IV = "IV";
    public static final String SYMMETRY_HEADER_SIGN = "SIGN";

    public static final String SIGN_SECRET_KEY = "SECRET_KEY";

    public static final String SIGN_NONCE_KEY = "NONCE";
    public static final String SIGN_TIMESTAMP_KEY = "TIMESTAMP";
    public static final String SIGN_TYPE_KEY = "SIGN_TYPE";
    public static final String SIGN_KEY = "KEY";

    public static final String CLIENT_REQUEST_TIME = "CLIENT_REQUEST_TIME";
    public static final String REQUEST_TO_GATEWAY = "REQUEST_TO_GATEWAY";
    public static final String TRACE_ID = "Trace_Id";

    // all digit
    public static final Pattern DIGITAL = Pattern.compile("^[-\\+]?[\\d]*$");
}
